package ch04_test;

public class Pro2 {
	public static void main(String[] args) {
		int[][] a = new int[8][5];
		int[][] b = new int[5][8];
		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 5; j++) {
				a[i][j] = i + j;
			}
		}
		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 5; j++) {
				System.out.printf("%-4d", a[i][j]);
			}
			System.out.println();
		}
		System.out.println("翻转后：");
		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 5; j++) {
				b[j][i] = a[i][j];
			}
		}
		for (int i = 0; i < 5; i++) {
			for (int j = 0; j < 8; j++) {
				System.out.printf("%-4d", b[i][j]);
			}
			System.out.println();
		}
	}
}
